#include <iostream>
#include <thread>
#include <future>

void print()
{
    std::cout << "helloworld" << std::endl;
}

int main()
{
    //async纯异步操作
    // auto a = std::async(std::launch::async,print);
    //deferred同步操作
    auto a = std::async(std::launch::deferred,print);
    std::cout << "main thread" << std::endl;
    a.get();
    return 0;
}